package com.hustcs.mindmap.drawmap.command;

import java.util.ArrayList;

public class MacroCommand implements Command {
	ArrayList<Command> commandList;
	
	public MacroCommand(ArrayList<Command> commandList) {
		this.commandList = commandList;
	}
	
	@Override
	public void execute() {
		for (int i = 0; i < commandList.size(); i++) {
			Command command = commandList.get(i);
			command.execute();
		}
		
	}

	@Override
	public void undo() {
		for (int i = 0; i < commandList.size(); i++) {
			Command command = commandList.get(i);
			command.undo();
		}
		
	}

	@Override
	public void redo() {
		
	}

}
